//
//  MYMyCommentListUserCell.swift
//  MuYing
//
//  Created by tbb on 2019/8/9.
//  Copyright © 2019 TBB. All rights reserved.
//

import UIKit

class MYMyCommentListUserCell: YQTableViewBaseCell {
    @objc @IBOutlet weak var nameLb: UILabel!
    @objc @IBOutlet weak var timeLb: UILabel!
    @objc @IBOutlet weak var commentBtn: UIButton!
    @objc @IBOutlet weak var userIcon: UIImageView!
    
    @objc var commentModel:YQPCommentModel? {
        didSet {
            if let count = self.commentModel?.name.count, count > 0{
                nameLb.text = self.commentModel?.name;
            }else{
                nameLb.text = self.commentModel?.username
            }
            
            timeLb.text = self.commentModel?.createTimeStr;
            if let headImg = self.commentModel?.headImg,headImg.count > 0 {
                userIcon.setImageWith(URL(string: headImg), placeholder: nil)
            }else{
                userIcon.setImageWith(URL(string: (self.commentModel?.headImage ?? nil) ?? ""), placeholder: nil)
            }
            
        }
    }
    
    override func awakeFromNib() {
        super.awakeFromNib()
        self.userIcon.layer.cornerRadius = 14;
        self.userIcon.clipsToBounds = true;
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }
    
}

